import { get, post } from "@/utils/request";

/**
 * 用户注册
 * @param params
 */
export const userRegister = async (params: any) => {
  return await post("/user/register", params);
};

/**
 * 用户登录
 * @param params
 */
export const userLogin = async (params: any) => {
  return await post("/user/login", params);
};

/**
 * 用户注销
 * @param params
 */
export const userLogout = async () => {
  return await post("/user/logout");
};

/**
 * 添加用户
 * @param params
 */
export const userAdd = async (params: any) => {
  return await post("/user/add", params);
};

/**
 * 更新用户
 * @param params
 */
export const userUpdate = async (params: any) => {
  return await post("/user/update", params);
};

/**
 * 删除用户
 * @param params
 */
export const userDelete = async (params: any) => {
  return await post("/user/delete", params);
};

/**
 * 通过id获取用户
 * @param id
 */
export const getUserId = async (id: string) => {
  return await get("/user/get");
};

/**
 * 通过id获取用户封装类
 * @param id
 */
export const getUserVOById = async (id: string) => {
  return await get("/user/get/vo");
};

/**
 * 获取当前登录用户
 */
export const getLoginUser = async () => {
  return await get("/user/get/login");
};

/**
 * 分页查询用户
 * @param params
 */
export const userByPage = async (params: any) => {
  return await post("/user/list/page", params);
};

/**
 * 分页查询用户封装类
 * @param params
 */
export const userVOByPage = async (params: any) => {
  return await post("/user/list/page/vo", params);
};
